package linkedlist;

public class LinkedListTest {
    public static void main(String[] args) {
        LinkedList<Integer> linkedList = new LinkedList<>();
        for (int i = 0; i < 5; i++) {
            linkedList.addFirst(i);
            System.out.println("linkedList = " + linkedList);
        }
        linkedList.add(2, 666);
        System.out.println("linkedList = " + linkedList);
        Integer remove = linkedList.remove(2);
        System.out.println("linkedList = " + linkedList);
        linkedList.removeFirst();
        System.out.println("linkedList = " + linkedList);
        linkedList.removeLast();
        System.out.println("linkedList = " + linkedList);

    }
}
